import { CSSProperties } from 'vue'
import { setStyle } from './style'

export * from './style'

export function createElement(
  tagName: keyof HTMLElementTagNameMap,
  attrbuite: Record<string, any> & { style?: CSSProperties },
  text: string
) {
  const el = document.createElement(tagName)
  setStyle(el, attrbuite.style || {})
  el.innerText = text

  return el
}
